package com.ice.framework.utils

import com.blankj.utilcode.util.PermissionUtils

object PermissionUtil {

    fun requestPermissions(permission:Array<String>,success:()->Unit,fail:()->Unit){
        if(PermissionUtils.isGranted(*permission)){
            success()
        }else{
            PermissionUtils.permission(*permission).callback(object:PermissionUtils.FullCallback{
                override fun onGranted(granted: MutableList<String>) {
                    success()
                }

                override fun onDenied(deniedForever: MutableList<String>, denied: MutableList<String>) {
                    fail()
                }

            }).request()
        }
    }
}